﻿using System;
namespace txcloud.sdk.Core
{
    public class TxRegion
    {
        internal string region { get; set; }

        public TxRegion(string region)
        {
            this.region = Convert(region);
        }

        internal string Convert(string name)
        {
            switch (name)
            {
                case "ap-beijing":
                case "北京": return "ap-beijing";
                case "ap-chengdu":
                case "成都": return "ap-chengdu";
                case "ap-guangzhou":
                case "广州": return "ap-guangzhou";
                case "ap-hongkong":
                case "中国香港": return "ap-hongkong";
                case "ap-seoul":
                case "首尔": return "ap-seoul";
                case "ap-shanghai":
                case "上海": return "ap-shanghai";
                case "ap-singapore":
                case "新加坡": return "ap-singapore";
                case "ap-frankfurt":
                case "法兰克福": return "eu-frankfurt";
                default:
                    return name;
            }
        }

        public string Get()
        {
            return region;
        }
    }
}
